<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>文件上传</title>
<!--框架必需start-->
<script type="text/javascript" src="../../libs/js/jquery.js"></script>
<script type="text/javascript" src="../../libs/js/language/cn.js"></script>
<script type="text/javascript" src="../../libs/js/framework.js"></script>
<link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" id="skin" prePath="../../"/>
<link rel="stylesheet" type="text/css" id="customSkin"/>
<!--框架必需end-->

<!-- 异步上传控件start -->
<script type="text/javascript" src="../../libs/js/form/upload/fileUpload.js"></script>
<script type="text/javascript" src="../../libs/js/form/upload/handlers.js"></script>
<!-- 异步上传控件end -->

</head>
<body>
  <div class="page_content">
  


			<div class="groupTitle"><span>1、用于新增</span></div>
  	
  	 <div class="red">此示例由后台支持</div>
		<p>默认文件类型无限制，大小限制1G</p>
	<table class="tableStyle" formMode="transparent" id="upload1">
		<tr>
			<td width="10%">上传文件：</td>
			<td>
				<span id="uploadBtn1"></span>
				<div id="uploadList1"></div>
				<!--下面的全部删除按钮是可选的，可以不加-->
				<div id="uploadDeleteAll1" style="display:none;"></div>
			</td>
		</tr>
	</table>

  <div class="height_15"></div>
  


			<div class="groupTitle"><span>2、用于编辑时</span></div>
  	
  	 <div class="red">此示例由后台支持</div>
  	 演示版中上传大小不能超过100k
	<table class="tableStyle" formMode="transparent" id="upload2">
		<tr>
			<td width="10%">上传文件：</td>
			<td>
				<span id="uploadBtn2"></span>
				<div id="uploadList2"></div>
			</td>
		</tr>
	</table>

  <div class="height_15"></div> 
  


			<div class="groupTitle"><span>3、限制文件类型、大小</span></div>
  	
  	 <div class="red">此示例由后台支持</div>
  	<p>在本实例中，仅允许上传图片，且大小不超过100k</p>
	<table class="tableStyle" formMode="transparent" >
		<tr>
			<td width="10%">上传文件：</td>
			<td>
				<span id="uploadBtn3"></span>
				<div id="uploadList3"></div>
			</td>
		</tr>
	</table>

    <div class="height_15"></div>
    
    


			<div class="groupTitle"><span>4、动态生成上传控件</span></div>
  	
  	 <div class="red">此示例由后台支持</div>
	<input type="button" value="点击生成上传控件" id="testBtn"/>



  </div>


<script type="text/javascript">
	var upload1;
	var catalogId1;
	
	var upload2;
	//这里的值取的是已经上传有附件的catalogId
	var catalogId2 = "3b7cf33f-d24c-434f-b081-a4f8f2f132be";
	
	var upload3;
	var catalogId3;
	function initComplete(){
	  // $("#upload1").mask("为防止随意上传大文件，此示例在演示版中禁用",0,false,"#ffffff");
	  /*
	   //生成catalogId
	    catalogId1 = $.fileUpload.generateCatalogId("../../fileAction.do?method=generateCatalogId");
		//初始化上传控件
		upload1 = $.fileUpload.start({
			contextPath: "<%=path%>",
			buttonContainer: "uploadBtn1",
			fileListContainer: "uploadList1",
			deleteContainer: "uploadDeleteAll1",
			moduleId : 'dcm',
			kind : 'template',
			catalogId: catalogId1,
			uploadUrl:"/fileAction.do?method=upLoadFile",
			deleteUrl:"/fileAction.do?method=delete&id=",
			deleteAllUrl:"/fileAction.do?method=deleteByKind",
			fileNameWidth:240
		});
		
		*/
		
		 //第二个上传控件
		/*
upload2 = $.fileUpload.start({
			contextPath: "<%=path%>",
			buttonContainer: "uploadBtn2",
			fileListContainer: "uploadList2",
			moduleId : 'dcm',
			kind : 'template',
			catalogId: catalogId2,
			fileSize: 100,
			uploadUrl:"/fileAction.do?method=upLoadFile",
			deleteUrl:"/fileAction.do?method=delete&id=",
			downloadUrl:"/fileAction.do?method=download&id=",
			listUrl:"/fileAction.do?method=listByKind",
			editMode:true
		});
*/
		
		
		 //第三个上传控件
	    /*
catalogId3 = $.fileUpload.generateCatalogId("../../fileAction.do?method=generateCatalogId");
		upload3 = $.fileUpload.start({
			contextPath: "<%=path%>",
			buttonContainer: "uploadBtn3",
			fileListContainer: "uploadList3",
			moduleId : 'images',
			kind : 'images',
			catalogId: catalogId3,
			uploadUrl:"/fileAction.do?method=upLoadFile",
			deleteUrl:"/fileAction.do?method=delete&id=",
			downloadUrl:"/fileAction.do?method=download&id=",
			fileSize: 100,
			fileTypes: '*.jpg; *.gif; *.png; *.jpeg; *.bmp'
		});
*/
	};
	
	//动态生成上传控件
	$(function(){
		/*
$("#testBtn").click(function(){
			var $fileUpload=$('<span id="uploadBtn4"></span><div id="uploadList4"></div></div>');
			$(this).after($fileUpload);
			$(this).after('<br/><br/>');
			var upload4;
   			var catalogId4;
   			 catalogId4 = $.fileUpload.generateCatalogId("../../fileAction.do?method=generateCatalogId");
			upload4 = $.fileUpload.start({
				contextPath: "<%=path%>",
				buttonContainer: "uploadBtn4",
				fileListContainer: "uploadList4",
				moduleId : 'dcm',
				kind : 'template',
				catalogId: catalogId4,
				fileSize: 100,
				uploadUrl:"/fileAction.do?method=upLoadFile",
				deleteUrl:"/fileAction.do?method=delete&id="
			});
		})
*/
	})

</script>

</body>
</html>